#include <stdio.h>
#include <math.h>

#define rep(i,n) for (int i=0; i<n; i++)

#define TRACE(x...) x
#define PRINT(x...) TRACE(printf(x))

int n;
int p;
bool primes[100010];

void sieve() {
	p=2;

	rep(i,100010) primes[i]=true;
	primes[0]=false; primes[1]=false;

	while (p*p<100010) {
		for (int i=2; i*p<100010; i++)
			primes[i*p]=false;

		while (!primes[++p])
			if (p*p>100010) break;
	}	
}

int cont;
int factor[1000];
int lim;
int tmp;

int main() {
	sieve();

	while (1) {
		scanf("%d", &n);
		if (!n) break;

		printf("%d = ", n);

		if (n<0) { 
			printf("-1 x ");
			n*=-1;
		}

		lim = sqrt(n)+1;
		tmp=n;
		cont=0;

		for (int i=2; i<lim; i++) {
			while (tmp%i==0 && primes[i]) {
				factor[cont++]=i;
				tmp/=i;
			}
		}

		if (tmp!=1) factor[cont++]=tmp;

		for (int i=0; i<cont; i++) {
			printf("%d", factor[i]);

			if ((i+1)<cont) printf(" x ");
		}

		printf("\n");
	}

	return 0;
}
